package rensoft.android.view.grid;

import rensoft.java.event.Event;

public class RequestRowData<T extends IGridRequest> implements RowData {

  private final T request;
  private final int rowIndexInRequest;

  public RequestRowData(T request, int rowIndexInRequest) {
    this.request = request;
    this.rowIndexInRequest = rowIndexInRequest;
  }

  @Override
  public Event<Void> eventLoaded() {
    return request.eventLoaded();
  }

  @Override
  public String getString(String key) {
    return request.getRow(rowIndexInRequest).getString(key);
  }

  @Override
  public boolean isDone() {
    return request.isDone();
  }

}
